<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>属性选择器</title>
    <style>
        [type=text]{
            background-color: pink;
        }
    </style>
</head>
<body>
<label for="text">姓名</label>
<input type="text" id="text"> <br>
<label for="password">密码</label>
<input type="password" id="password">
</body>
</html>